package com.java.zhuiyun.api.member_manager_pc.controller;

import com.java.zhuiyun.api.member_manager_pc.service.MemberManagerPcService;
import com.java.zhuiyun.common.response.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName MemberManagerPcController
 * @Description TODO
 * @Author wuwan
 * @Date 2023/8/28 20:35
 **/
@RestController
@CrossOrigin
@RequestMapping("/MemberManagerPc")
public class MemberManagerPcController {
    @Autowired
    private MemberManagerPcService memberManagerPcService;
    /*
    * @Author wuwan
    * @Description 个人信息会员管理
    * @Date 2023/8/29 8:28
    * @Return
    * @param null
    */
    @GetMapping("/getMemberManagerPc")
    public CommonResult getMemberManagerPc(Integer uid){
        return CommonResult.ok(memberManagerPcService.getMemberManagerPc(uid));
    }
    /*
    * @Author wuwan
    * @Description 个人信息订单管理
    * @Date 2023/8/29 8:29
    * @Return
    * @param null
    */
    @GetMapping("/getUserCourse")
    public CommonResult getUserCourse(Integer uid,Integer orderStatus){
        CommonResult userCourse = memberManagerPcService.getUserCourse(uid,orderStatus);
        return CommonResult.ok(userCourse);
    }
    /*
    * @Author wuwan
    * @Description 用户已购课程
    * @Date 2023/8/30 8:56
    * @Return
    * @param null
    */
    @GetMapping("/getPurchasedCourse")
    public CommonResult getPurchasedCourse(Integer uid){

        return CommonResult.ok(memberManagerPcService.getPurchasedCourse(uid));
    }
}
